package com.cs.common.sequence;

import java.util.Arrays;
import java.util.List;
import java.util.UUID;

/**
 * 获取UUID
 */
public class UUIDGenerator {

    public static String getUUID() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }

    public static String[] uuidarray(int num) {
        if (num < 1) {
            return null;
        }
        String[] uuids = new String[num];
        for (int i = 0; i < num; i++) {
            uuids[i] = getUUID();
        }
        return uuids;
    }

    public static List<String> uuidList(int num) {
        return Arrays.asList(uuidarray(num));
    }
}
